export const mockAdminList = () => {
    const total = 1 + Math.random() * 10
    const list = Array.from({ length: total }, (_, index) => {
        return {
            id: index + 1,
            name: `Admin ${index + 1}`,
            email: `admin${index + 1}@example.com`,
            roles: `管理员`,
            createdAt: new Date(Date.now() - 1000 * 60 * 60 * 24 * (index + 1)),
            updatedAt: new Date(),
        }
    })
    return list
}

export const mockAdminRoles = ()=> {
    return [
        { label: '超级管理员', value: 'admin' },
        { label: '管理员', value: 'editor' },
        { label: '普通用户', value: 'user' },
        { label: '财务', value: 'finance' },
        { label: '行政', value: 'administration' },
    ]
}

export const mockGetMenus = () => {
    const menuItem = {
        id: Math.random() * 1000,
        pid: Math.random() * 1000,
        icon: '',
        menu_name: '添加商品',
        module: '添加商品',
        controller: '添加商品',
        action: '添加商品',
        api_url: 'https://www.yuque.com/lipengzhou/shop-admin-vue3/vkceak',
        methods: ['GET', 'POST', 'PUT', 'DELETE'],
        params: 'menus',
        sort: 1,
        is_show: 1,
        is_show_path: 1,
        access: 1,
        menu_path: '/product/product_list',
        path: '/product/product_list',
        auth_type: 2,
        header: '',
        is_header: 1,
        unique_auth: 1,
        is_del: 1,
        statusLoading: false,
        children: []
    }
    return new Array(15).fill(menuItem)
}